using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Ray.Web.Models;

using Castle.ActiveRecord;
using Castle.ActiveRecord.Framework.Config;

namespace Ray.Web
{
    public partial class CURD : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            XmlConfigurationSource source = new XmlConfigurationSource(MapPath("appconfig.xml"));

            ActiveRecordStarter.Initialize(source, typeof(Ray_Column), typeof(Ray_Master), typeof(Ray_Content));

            // 2. Create the schema 

            // If you want to let AR to create the schema
            
            //ActiveRecordStarter.CreateSchema();




            Ray_Master master = new Ray_Master("jecray", "jecray", "columnsetting", "setting", DateTime.Now, "192.168.1.188", "nothing", false);
            master.Create();
        }
    }
}
